package com.zm.base.core.dao;

import com.zm.base.core.exception.BaseException;

public interface IBaseDao {
	/**
	 * 新增
	 * @param t
	 * @return
	 * @throws BaseException
	 * @throws Exception
	 */
	public <T> void save(T t) throws BaseException,Exception;
	/**
	 * 删除（对象中主键不能为空）
	 * @param t
	 * @throws BaseException
	 * @throws Exception
	 */
	public <T> void delete(T t) throws BaseException,Exception;
	/**
	 *根据id删除
	 * @param id
	 * @throws BaseException
	 * @throws Exception
	 */
	public<T>  void delete(Class<T> clazz,Object id)throws BaseException,Exception;
	/**
	 * 更新
	 * @param t
	 * @return
	 * @throws BaseException
	 * @throws Exception
	 */
	public<T> void update(Class<T> clazz,T t,boolean isAll)throws BaseException,Exception;
	/**
	 * 根据id查询po
	 * getById:() 
	 * @author chenhuaming 
	 * @param clazz
	 * @param id
	 * @return
	 * @throws BaseException
	 * @throws Exception
	 */
	public <T> T getById(Class<T> clazz,String id)throws BaseException,Exception;
	
}
